﻿/*
 *********************************************************************
 *    Management Extensions for Windows Windows Server AppFabric     *
 *********************************************************************
 *    Author    : Fatih Boy [fatih@enterprisecoding.com]             *
 *    Web site  : http://www.enterprisecoding.com                    *
 *********************************************************************
 *    License   : GNU Library General Public License (LGPL)          * 
 *********************************************************************
 */

using System.Management.Automation.Host;
using System.Reflection;
using System;
using System.Threading;
using System.Globalization;

namespace Com.Enterprisecoding.AppFabric.Extensions.Powershell {
    internal sealed class ExtensionsHost : PSHost {
        private Version assemblyVersion;
        private Guid instanceId;
        private ExtensionsHostUI hostUI;

        public ExtensionsHost() {
            var executingAssembly = Assembly.GetExecutingAssembly();
            var assemblyName = executingAssembly.GetName();

            assemblyVersion = assemblyName.Version;
            instanceId = Guid.NewGuid();

            hostUI = new ExtensionsHostUI();
        }

        public override CultureInfo CurrentCulture {
            get { return Thread.CurrentThread.CurrentCulture; }
        }

        public override CultureInfo CurrentUICulture {
            get { return Thread.CurrentThread.CurrentUICulture; }
        }

        public override void EnterNestedPrompt() {
            throw new System.NotImplementedException();
        }

        public override void ExitNestedPrompt() {
            throw new System.NotImplementedException();
        }

        public override Guid InstanceId {
            get { return instanceId; }
        }

        public override string Name {
            get { return "AppFabricExtensionsHost"; }
        }

        public override void NotifyBeginApplication() {
            throw new System.NotImplementedException();
        }

        public override void NotifyEndApplication() {
            throw new System.NotImplementedException();
        }

        public override void SetShouldExit(int exitCode) {
            throw new System.NotImplementedException();
        }

        public override PSHostUserInterface UI {
            get { return hostUI; }
        }

        public override System.Version Version {
            get { return assemblyVersion; }
        }
    }
}